const {workerData} = require('worker_threads')
const {pluginName, options} = workerData
const MyNode = require(`./packages/${pluginName}/index.js`)

const streamOutput = (data) => {
    console.log("流式输出:" + data)
}
options.streamOutput = streamOutput

const mynode = new MyNode(options)

const executePromise = mynode.execute()
if(executePromise instanceof Promise) {
    executePromise.then(res => {
        console.log(res)
    })
} else {
    console.log(executePromise)
}